#td = tempfile()
#dir.create(td)

write( "Second quarter graphics chip shipments: AMD tops the chart, Intel is up, Nvidia is down", file=paste(td, "D1", sep="/") )
write( "hart showing double bottom with open gap to close at 4.37$ - also showing some BULLISH OPTIONS FLOW - 13% float is short", file=paste(td, "D2", sep="/") )
write( "on the move - highlighted 2,500 Aug. 3.50 calls at $0.20 this morning bought", file=paste(td, "D3", sep="/") )
write( "AMD's Groundbreaking Never Settle Forever Program Empowers Gamers to Choose.", file=paste(td, "D4", sep="/") )
write( "Nvidia Slips: Bulls Cheer GPU Momentum, Bears Fear Lack of Tegra Wins - Tech Trader Daily", file=paste(td, "D5", sep="/") )
write( "AMD Falls 13% Even as Price Targets, Estimates Rise - Tech Trader Daily - $AMD $INTC $MSFT $SNE $NVDA ", file=paste(td, "D6", sep="/") )
write( "AMD rise tops break", file=paste(td, "D7", sep="/") )
#write( "", file=paste(td, "D3", sep="/") )


data(stopwords_en)
myMatrix = textmatrix(td, stopwords=c(","))
myMatrix = lw_logtf(myMatrix) * gw_idf(myMatrix)
myLSAspace = lsa(myMatrix, dims=dimcalc_share())
tm =  as.textmatrix(myLSAspace)
d = dist(t(tm))

fit = cmdscale(d, eig=T, k =2)
points <- data.frame(x = fit$points[, 1], y = fit$points[, 2])
plot(points$x, points$y)

